#pragma once
#include "xchainedmap.h"
#include "CMILMatrix.h"

class HWTexture;
#include "CTiledSurface.h"

class CTileIterator
{
public: 
	CTileIterator();
	~CTileIterator();
	void SetTiled(CTiledSurface * pTiledSurface, const CMILMatrix * pBrushToElement);
	void SetNonTiled(HWTexture * pTexture);
	void SetBrushToElementTransform(const CMILMatrix *);
	XBOOL HasMoreTiles();
	void Advance();
	HWTexture * GetCurrentTextureNoRef();
	void GetTileBounds(struct XRECTF_WH * pBounds);
	XBOOL IsTiling();
	struct XSIZEF GetImageSourceSize();
	void GetBrushToElementTransform(CMILMatrix * pTransform);
	XUINT32 GetCurrentAAMask();

private: 
	xchainedmap<XPOINT,CTiledSurface::Tile *>::const_iterator m_tileIterator;  
	CTiledSurface * m_pTiledSurface;
	CMILMatrix m_brushToElement;
	HWTexture * m_pTexture;
	XUINT32 m_index;
};


